#include "Precompiled.hpp"
#include "CoolButton.h"

CoolButton::CoolButton(void)
{
}

CoolButton::~CoolButton(void)
{
}
void CoolButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
    std::cout << "CoolButton::DrawItem()" << std::endl;
    HDC hdc = lpDrawItemStruct->hDC;
    RECT rect = lpDrawItemStruct->rcItem;

    Rect rc(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
    Graphics gfx(hdc);
    SolidBrush blackBrush(Color(0, 0, 0));
    gfx.FillRectangle(&blackBrush, rc);

    // if(lpDrawItemStruct->itemState &  ODS_SELECTED
    //     || lpDrawItemStruct->itemState & ODS_FOCUS){
    //     rc.Inflate(-1, -1);
    //     SolidBrush redBrush(Color(228, 96, 96));
    //     gfx.FillRectangle(&redBrush, rc);

    //     rc.Inflate(-1, -1);
    //     LinearGradientBrush graRedBrush(rc, Color(214, 41, 41), Color(132, 19, 19), LinearGradientModeVertical);
    //     gfx.FillRectangle(&graRedBrush, rc);
    // }
    Image image(L"close_normal.png");
    gfx.DrawImage(&image, rc);
    rect_ = rc;    
    
}
